package aash.catalog.views.panel;

import aash.catalog.views.component.AashComponent;
import javax.swing.JPanel;

/**
 * Abstract class for panels.
 * @author Aashintan
 */
public abstract class AashPanel extends JPanel implements AashComponent {
    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = -2613082593136185686L;
    /**
     * Transparency ratio.
     */
    private float alpha = 1F;

    /**
     * Set transparency level.
     * @param fAlpha ratio
     */
    public final void setAlpha(final float fAlpha) {
        if (fAlpha != 1F) {
            setOpaque(false);
        } else {
            setOpaque(true);
        }
        alpha = fAlpha;
    }

    /**
     * @return alpha
     */
    public final float getAlpha() {
        return alpha;
    }
}
